//
//  CallPhoneCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/1.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "CallPhoneCell.h"

@implementation CallPhoneCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _orangeLab = [[UILabel alloc] initWithFrame:CGRectMake(2, 2, 3,55)];
        _orangeLab.backgroundColor = OverColor;
        [self addSubview:_orangeLab];
        //图片
        _peopleImg = [[UIImageView alloc] init];
        //_peopleImg.backgroundColor = [UIColor redColor];
        _peopleImg.image = [UIImage imageNamed:@"nanshihui"];
        [self addSubview:_peopleImg];
        [_peopleImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(16, 16));
            make.left.equalTo(_orangeLab.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(5);
        }];
        //客户姓名
        _nameLab = [[UILabel alloc] init];
        _nameLab.textColor = OverColor;
        _nameLab.font = [UIFont systemFontOfSize:14];
        _nameLab.text = @"夏侯夜华";
        [self addSubview:_nameLab];
        [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(100, 15));
            make.left.equalTo(_peopleImg.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(5);
        }];
        
        //性别
        _sexLab = [[UILabel alloc] init];
        _sexLab.text = @"男";
        _sexLab.textColor = [UIColor blackColor];
        _sexLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_sexLab];
        [_sexLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(20, 15));
            make.left.equalTo(_nameLab.mas_right).offset(20);
            make.top.equalTo(self.mas_top).offset(5);
        }];
        _oneLine = [[UILabel alloc] init];
        _oneLine.backgroundColor = [UIColor grayColor];
        [self addSubview:_oneLine];
        [_oneLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(1, 10));
            make.left.equalTo(_sexLab.mas_right).offset(5);
            make.top.equalTo(self.mas_top).offset(7);
        }];
        
        //类别
        _sexLab= [[UILabel alloc] init];
        _sexLab.text = @"A类";
        _sexLab.textColor = [UIColor blackColor];
        _sexLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_sexLab];
        [_sexLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(30, 15));
            make.left.equalTo(_oneLine.mas_right).offset(10);
            make.top.equalTo(self.mas_top).offset(5);
        }];
        
        //首次来电
        _firstLab = [[UILabel alloc] init];
        _firstLab.text = @"首次来电 | 2016-11-09";
        _firstLab.textColor = [UIColor grayColor];
        _firstLab.font = [UIFont systemFontOfSize:10];
        [self addSubview:_firstLab];
        [_firstLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(120, 15));
            make.left.equalTo(_orangeLab.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(25);
        }];
        //上次跟进
        _shangLab = [[UILabel alloc] init];
        _shangLab.text = @"上次跟进 | 2016-12-15";
        //_shangLab.backgroundColor = [UIColor blueColor];
        _shangLab.textColor = [UIColor grayColor];
        _shangLab.font = [UIFont systemFontOfSize:10];
        [self addSubview:_shangLab];
        [_shangLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(120, 15));
            make.left.equalTo(_orangeLab.mas_right).offset(8);
            make.top.equalTo(self.mas_top).offset(40);
        }];
        
        
        
        //电话
        _callBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        //_callBtn.backgroundColor = [UIColor orangeColor];
        _callBtn.layer.cornerRadius = 20;
        [_callBtn setImage:[UIImage imageNamed:@"dianhuatubiao"] forState:0];
        [_callBtn addTarget:self action:@selector(callBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_callBtn];
        [_callBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_offset(40);
            make.right.equalTo(self.mas_right).offset(-20);
            make.top.equalTo(self.mas_top).offset(10);
        }];
        
        //备注
        _remarkLab = [[UILabel alloc] init];
        _remarkLab.text = @"下周抽时间来看看具体情况";
        _remarkLab.textColor = [UIColor grayColor];
        _remarkLab.font = [UIFont systemFontOfSize:10];
        [self addSubview:_remarkLab];
        [_remarkLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(150, 15));
            make.left.equalTo(_shangLab.mas_right).offset(10);
            make.top.equalTo(self.mas_top).offset(40);
        }];

        
    }
    return self;
}

-(void)callBtnClick:(UIButton *)btn
{
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
